package cn.njyd.corejava.thread.myday05;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerDemo02 {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(10);
        System.out.println(atomicInteger.compareAndSet(10,20));
        System.out.println("比较并交换"+atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(10,2025)+"结果"+atomicInteger.get());
    }
}
